package com.aia.ann.web;

import org.apache.log4j.Logger;

import com.aia.ann.domain.Insu;
import com.aia.ann.service.ChiefService;
import com.cfh.util.Tools;
import com.opensymphony.xwork2.ActionSupport;

public class ProtectionResultAction extends ActionSupport {
	private static final long serialVersionUID = 1L;
	private static final Logger logger = Logger.getLogger(ProtectionResultAction.class);
	private String guid;
	private ChiefService chiefService;
	private Insu insu = new Insu();
	private long avgnum;

	public void setGuid(String guid) {
		this.guid = guid;
	}

	public String getGuid() {
		return guid;
	}

	public String execute() throws Exception {
		try {
			if (logger.isDebugEnabled()) {
				logger.debug("execute() - start"); //$NON-NLS-1$
			}
			chiefService.getInsuByGuid(this);
			
			if (logger.isDebugEnabled()) {
				logger.debug("execute() - end"); //$NON-NLS-1$
			}
			return Tools.smartReturn((ActionSupport) this);
		} catch (Exception e) {
			logger.error("Unknown Error:" + e, e);
			throw new RuntimeException(e);
		}

	}

	public void setChiefService(ChiefService chiefService) {
		this.chiefService = chiefService;
	}

	public ChiefService getChiefService() {
		return chiefService;
	}

	public void setInsu(Insu insu) {
		this.insu = insu;
	}

	public Insu getInsu() {
		return insu;
	}

	public void setAvgnum(long avgnum) {
		this.avgnum = avgnum;
	}

	public long getAvgnum() {
		return avgnum;
	}

}
